@extends('host.custom.common.common')

@section('c-head')
    <script>
        var PAGE_DATA = {
            pagingObj : {
                total : 0,
                perpage : 7,
                page : 1
            }
        };
    </script>
@stop

@section('body')
        <!-- top_test -->
<div id="top_test"></div>

<!-- web_logo_search -->
<div id="web_logo_search"></div>

<!-- comm_nav -->
<div id="comm_nav"></div>

<div class="com-w mt20">
    <div class="wrapper clearfix">
        <div id="commleftmenu" class="w220 mr20 comm-left-menu">
            <div class="menu-top-title">采购商中心</div>
            <div id="leftmenuitems"></div>
        </div>
        <div class="w960 comm-main">
            <div class="main-release clearfix">
                <div class="main-release-nav">
                    您当前的位置：
                    <a href="javascript:void(0)">首页</a>
                    >
                    <a href="javascript:void(0)">采购商中心</a>
                    > 地址管理
                </div>
                <div class="main-release-title">
                    <span class="icons"></span>
                    <span class="release-title-h3 f16">地址管理</span>
                </div>
                <div class="main-release-from">
                    <div class="add-address-btn">
                        <span class="btn btn-default btn-w90x32 mt25 ml15" id="add">新增地址</span>
                    </div>
                    <div class="my-address">
                        <div class="head">
                            <ul class="clearfix">
                                <li class="wb15">收件人姓名</li>
                                <li class="wb20">所在地区</li>
                                <li class="wb20">详细地址</li>
                                <li class="wb10">邮政编码</li>
                                <li class="wb15">电话/手机</li>
                                <li class="wb20">操作</li>
                            </ul>
                        </div>
                        <div class="my-address-list" id="commTabs_1_body">

                        </div>
                        <div id="comm-paging" class="comm-paging" style="float: right;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- foot_nav -->
<div id="foot_nav"></div>

<div id="bottom_main"></div>
<!-- 列表模板 -->
<script type="text/template" id="item-template">
    <%_.each(obj, function(item){%>
    <ul class="clearfix" data-id="<%=item.id%>">
        <li class="wb15"><%=item.name %></li>
        <li class="wb20" title="<%=item.provname %> <%=item.city %><%=item.area %> ">
            <%=item.provname %>
            <%=item.city %>
            <%=item.area %></li>
        <li class="wb20" title="<%=item.addr %>">

            <%=item.addr %>
        </li>
        <li class="wb10"><%=item.postnum %></li>
        <li class="wb15"><%=item.tel %></li>
        <li class="wb20">
            <div class="mt10">
                <span class="btn btn-warn btn-w70x32 editor-btn">编辑</span>
                <span class="btn btn-default btn-w70x32 sel-edit-del">删除</span>
            </div>
        </li>
    </ul>
    <%});%>
</script>
<!-- 新增弹出框 -->
<script type="text/template" id="classify-templ">
    <form id="addform" action="" method="post" >
        {{ csrf_field() }}
        <div class="dialog-div">
            <div class="clearfix">
                <div class="editor-l">收货人姓名：</div>
                <div class="editor-r">
                    <input type="text" id="name" name="name"></div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">所在地区：</div>
                <div class="editor-r">
                    <select id="province" name="province_id" style="width:100px"> <option value="">请选择</option> </select>
                    <select id="city" name="city_id" style="width:100px"> <option value="">请选择</option> </select>
                    <select id="country" name="county_id" style="width:100px"> <option value="">请选择</option> </select>
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">详细地址：</div>
                <div class="editor-r">
                    <input type="text" id="addr" name="detail_area"></div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">邮政编码：</div>
                <div class="editor-r">
                    <input type="text" id="postnum" name="code" value="<%=obj.postnum %>"></div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">电话/手机：</div>
                <div class="editor-r">
                    <input type="text" id="tel" name="tel_phone" value="<%=obj.tel %>"></div>
            </div>
            <div class="clearfix mt10">
                <div class="tc">
                    <button class="btn btn-warn btn-w140x40 ml40 lh30 f14" i="save">保存</button>
                </div>
            </div>
        </div>
    </form>
</script>
<!-- 编辑弹出框 -->
<script type="text/template" id="edit_templ">
    <form id="editform" action="{{ route('account.address.index') }}/<%=obj.id%>" method="post" >
        <input name="_method" value="PUT" hidden="hidden">
        {{ csrf_field() }}
        <div class="dialog-div">
            <div class="clearfix">
                <div class="editor-l">收货人姓名：</div>
                <div class="editor-r">
                    <input type="text" id="name" name="name" value="<%=obj.name %>"></div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">所在地区：</div>
                <div class="editor-r">
                    <select id="province" name="province_id" style="width:100px"> <option value="">请选择</option> </select>
                    <select id="city" name="city_id" style="width:100px"> <option value="">请选择</option> </select>
                    <select id="country" name="county_id" style="width:100px"> <option value="">请选择</option> </select>
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">详细地址：</div>
                <div class="editor-r">
                    <input type="text" id="addr" name="detail_area" value="<%=obj.addr %>"></div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">邮政编码：</div>
                <div class="editor-r">
                    <input type="text" id="postnum" name="code" value="<%=obj.postnum %>"></div>
            </div>
            <div class="clearfix mt10">
                <div class="editor-l">电话/手机：</div>
                <div class="editor-r">
                    <input type="text" id="tel" name="tel_phone" value="<%=obj.tel %>"></div>
            </div>
            <div class="clearfix mt10">
                <div class="tc">
                    <button class="btn btn-warn btn-w140x40 ml40 lh30 f14" i="editsub">保存</button>
                </div>
            </div>
        </div>
    </form>
</script>
<!-- 省市区 -->
<script type="text/template" id="area-option-templ">
    <option value="">请选择</option>
    <% _.each(obj, function(item){%>
    <option value="<%=item.code %>"><%=item.text %></option>
    <% }); %>
</script>
<!-- 确认框 -->
<script type="text/template" id="item-confirm">
    <div class="dialog-div">
        <div>是否确认处理该条信息</div>
        <div class="price-game-btn">
            <div class="btn btn-gray btn-w140x40 remove">取消</div>
            <div class="btn btn-warn btn-w140x40" id="tj">提交</div>
        </div>
    </div>
</script>

<script src="/assets/b2b/js/libs/jquery.validate.min.js"></script>
<script src="/assets/b2b/js/libs/messages_zh.js"></script>
<script type="text/javascript" src="/assets/b2b/js/libs/dialog-min.js"></script>
<script src="/assets/b2b/js/libs/jquery.paging.min.js"></script>
<script src="/assets/b2b/js/pageModules/buyer/B13.js"></script>
@stop